<template>
  <n-flex vertical justify="center" class="carts-box type-area">
      <h1>{{options.msg.title}}</h1>
      <p>{{options.msg.info}}</p>
      <n-grid :cols="csg" class="grid-cart" :x-gap="120/csg">
        <n-gi v-for="(item) in options.cart" :key="item.id" >
          <n-card :title="item.title" hoverable class="carts-item">
            <template #cover>
              <img :src="item.src" height="156px">
            </template>
            {{item.label}}
            <template #footer >
              <slot name="footer"></slot>
            </template>
          </n-card>
        </n-gi>
      </n-grid>
  </n-flex>
</template>

<script>
import {ref,defineComponent} from 'vue'
export default defineComponent({
  name: "CartGroup",
  props: {
    options: {
      required: true
    }
  },
  data(){
    return{
      csg:ref(this.options.cart.length)
    }
  }
})
</script>

<style lang="scss" scoped>
.carts-box{
  position: relative;
  text-align: center;
  h1{
    font-weight: 800;
    font-size: 36px;
    margin-bottom: .2rem;
  }
  p{
    margin-top: 0;
  }
}
.carts-item{
  position: relative;
  width: 100%;
  text-align: left;
}
.grid-cart{
  margin: 0 auto;
}
</style>